Mediators spent weeks working on a plan to bridge nearly half a century of hostility between Washington and Tehran