New York's main contract, light sweet crude for February delivery, gained 26 cents to $101.60 per barrel and Brent North Sea crude for February delivery rose 12 cents to $109.39.
"Oil is basking in the glory of a year-end rally. Still as oil ends the year it is obvious that risks are rising," Phil Flynn, senior energy analyst of PFGBEST, said in a report.
Several Western states are considering oil sanctions against Iran over its nuclear programme, accusing it of seeking to develop nuclear weapons.
Iranian Vice President Mohammad Reza Rahimi made his threat Tuesday as Tehran conducted navy war games near the Strait of Hormuz, at the entrance of the oil-rich Gulf where 40% of the world's oil transits.
"The vice president of Iran says if there are sanctions they will close the straits... Oil that has been held in check by the uncertain outlook for Europe may focus on threats to supply as we start the new year," said Flynn.
The strait links the Gulf, bordered by petroleum-rich states such as Bahrain, Kuwait, Qatar, Saudi Arabia and the United Arab Emirates, with Oman.