Oil prices were little changed on Wednesday after two straight days of losses, as the deadlock in Gaza ceasefire talks renewed uncertainty about the security of supplies from the Middle East, offsetting a bigger-than-expected build in U.S. crude inventories.

Brent crude futures were up marginally at $89.49 per barrel at 0330 GMT, while U.S. West Texas Intermediate (WTI) crude futures rose 8 cents to $85.31.

Prices for both benchmarks remain down around 1.8% on the end of last week despite geopolitical tensions in the Middle East triggered by the prospect of Israel's war in Gaza lasting longer, and drawing in more countries.

"Some of the heat has come out of rally in crude oil in the early part of this week on hopes of a ceasefire in Gaza and higher US inventories," said Tony Sycamore, a market analyst at IG in Singapore.

Hamas said on Tuesday that an Israeli proposal on a ceasefire in their war in Gaza did not meet the demands of Palestinian militant factions, but it would study the offer further and deliver its response to mediators.

If the conflict continues, it risks the involvement of other countries in the region, particularly Hamas backer Iran, the third-largest producer in the Organization of the Petroleum Exporting Countries (OPEC).

Meanwhile, U.S. crude stocks climbed last week by 3.03 million barrels, according to market sources citing American Petroleum Institute figures. Analysts had estimated that stocks would rise by about 2.4 million barrels.

Official U.S. government inventory data is due at 1430 GMT.

However, all the risks remain to the upside, IG's Sycamore said.

"Anything from a cooler-than-expected US CPI tonight to another Ukrainian drone attack on Russian oil infrastructure to a response from Iran after Israel killed two of its generals in Syria last week is more than capable of re-igniting the uptrend," he added.

Separately, the government raised its forecast for U.S. crude oil output, expecting an increase of 280,000 bpd to 13.21 million bpd in 2024, up 20,000 bpd from an earlier forecast from the U.S. Energy Information Administration (EIA).

However, EIA said it expects Brent crude prices to average $88.55 a barrel in 2024, up from a previous forecast of $87 a barrel.

On Tuesday, both Brent and WTI fell more than 1%, as Israel-Hamas ceasefire discussions in Cairo continued.

The commander of the Revolutionary Guard's navy in Iran said it could close the Strait of Hormuz if deemed necessary. About a fifth of the volume of the world's total oil consumption passes through the strait daily.

Turkey said it would restrict exports of various products, including jet fuel, to Israel until there is a ceasefire. Israel said it would respond with its own curbs.

(Reporting by Arathy Somasekhar in Houston; Editing by Sonali Paul and Miral Fahmy)