Iranian President Hassan Rouhani has warned against spread of extremism and terrorism in the Middle East at a meeting with United Arab Emirates' foreign minister.