Iran has intensified its diplomacy with friends and foes alike in recent months, seeking to reduce its isolation, improve its economy, and project strength.