The escalating American confrontation with Iran poses a major new political threat to President Obama as he heads into his campaign for re-election, presenting him with choices that could harm either the economic recovery or his image as a firm leader.

Sanctions against Iran’s oil exports that the president signed into law on New Year’s Eve started a fateful clock ticking. In late June, when the campaign is in full swing, Mr. Obama will have to decide whether to take action against countries, including some staunch allies, if they continue to buy Iranian oil through its central bank.