Pedro Sánchez may be embattled at home, but his opposition to the war in Iran has boosted his clout on the rest of the continent.