U.S. stocks snapped a two-day losing streak on Thursday, the last trading day for the week, as investors digested economic data, set up for Friday's jobs report and weighed news of a possible accord between Iran and major world powers.

"This is a very complicated geopolitical situation and this is a step in the right direction," said Art Hogan, chief market strategist at Wunderlich Securities. "The framework has been accepted in a very calm fashion."