US benchmark West Texas Intermediate for July delivery edged higher by five cents to USD 104.40 a barrel on the New York Mercantile Exchange.
In London, European benchmark Brent oil for July delivery advanced 43 cents to USD 109.95 a barrel on the Intercontinental Exchange.
The gains followed a weekly oil-inventory report by the US Department of Energy which showed crude stocks fell 2.6 million barrels, more than the 1.7 million forecast by analysts surveyed by Dow Jones Newswire.
The report also showed a 200,000 barrel decline at a widely watched US oil-trading hub in Cushing, Oklahoma.
The assault by the Islamic State of Iraq and the Levant has driven some 500,000 people from their homes and spurred pledges from both the US and Iran for more aid to Iraq.
The oil market has so far not reacted strongly to the Iraq violence because "traders are probably saying this is far from the oil sector," said Michael Lynch, president of consultancy Strategic Energy & Economic Research.
As expected, the Organisation of Petroleum Exporting Countries, which pumps out about one third of the world's oil, agreed to maintain its oil production ceiling at 30 million barrels per day.
Saudi Oil Minister Ali al-Naimi said he was "very happy" with the oil market. US oil prices have traded above $100 a barrel for most of the last two months.
