US oil settles up 84 cents, or 1.6%, at $53.04 a barrel

Oil prices rose on Tuesday, reversing losses after Tehran and six global powers reached a landmark nuclear deal that left sanctions on Iran in place for now, continuing to limit its crude exports.

U.S. crude closed up 84 cents, or 1.6 percent, at $53.04 a barrel, bouncing back from a bottom of $50.38.

Front-month Brent crude futures were up 55 cents at $58.40 a barrel, having earlier hit a session low of $56.43.

The dollar's slide after unexpectedly weak U.S. retail sales for June also helped pare early losses in crude futures.

The oil market will be looking out next for an industry group report due later on Tuesday that will indicate supply-demand for U.S. crude. The American Petroleum Institute's report for last week will land ahead of official crude inventory data due on Wednesday from the U.S. government.

Read MoreNatural gas tops coal as top source of electric power generation in US

"The market was short going into the Iran agreement but the bears did not get the selloff they were hoping, so we're going back up," said Scott Shelton, commodities specialist and crude broker with ICAP in Durham, North Carolina.

Under the nuclear deal, sanctions imposed by the United States, European Union and United Nations would be lifted in exchange for curbs on Iran's nuclear program. There were no immediate details on how long it would take for the sanctions to come off, although analysts did not expect them to happen right away.

"Even with a historic deal, oil from Iran will take time to return, and will not be before next year, most likely the second half of 2016," Amrita Sen, chief oil analyst at London-based consultancy Energy Aspects, told Reuters.

Read MoreForget Iran. This is what's driving down oil: CEO

Sanctions have almost halved Iranian oil exports, to just over 1 million barrels per day (bpd). With the nuclear deal, it raise exports by up to 60 percent within a year, a Reuters survey of analysts said.

The global petroleum market is meanwhile burdened by an oversupply of about 2.5 million bpd.

Some think the nuclear deal will eventually lead to a new price war in crude markets as Iran ramps up supply.

Others, like SEB Markets chief analyst Bjarne Schieldrop, disagree, saying it might be time to buy oil again.

"OPEC will however manage total volume of oil into the global oil market as there is no reason to drive the oil price substantially below $60 a barrel."