The market's cautious optimism came despite fresh U.S. airstrikes on Iran and Tehran's retaliatory attacks against U.S. allies in the Middle East.