WASHINGTON—President Barack Obama vowed to veto any legislation approving new economic sanctions against Iran, placing him on a collision course with the Republican-controlled Congress as U.S. diplomats seek to secure a deal curtailing Tehran’s nuclear program by July.

Mr. Obama and British Prime Minister David Cameron, appearing at a joint news conference Friday, both said the enactment of new financial penalties on Iran could unravel more than a year of high-level diplomacy and rekindle fears of a Western military confrontation...