U.S. and European leaders pledged on Wednesday to work together to keep Iran from developing nuclear weapons , presenting a united front after months of bitter acrimony over Iraq .