By Christian Berthelsen 

The U.S. benchmark oil contract slipped on Friday, but remained within striking distance of its biggest weekly gain in four years, as concerns about fighting in the Middle East faded.

Crude oil for May delivery fell $1.41, or 2.7% to $50.02 a barrel on the New York Mercantile Exchange, on track to post the largest weekly gain since Feb. 25, 2011. Oil prices have been climbing this past week as the dollar has cooled from its recent highs, a factor that has prompted some investors to dive back into commodities, and as geopolitical strife in the Middle East raised concerns about potential supply interruptions.

Brent crude, the global benchmark, was down $1.44, or 2.4%, at $57.75 a barrel on the ICE Futures Europe exchange.

Before Friday, U.S. oil futures have risen five sessions in a row, with prices at their highest levels since early March. Oil has rallied despite rising supplies, with the U.S. Energy Information Administration reporting this past week that U.S. stockpiles rose to another all-time record high.

Thursday's gain, the biggest in six weeks, was fueled by an escalation of the conflict in Yemen. Saudi Arabia launched airstrikes on Shiite Houthi rebels threatening to overtake the U.S.-backed government of President Abd-Rabbu Mansour al-Hadi. U.S. oil futures soared 4.5% on Thursday. Saudi Arabia and United Arab Emirates continued airstrikes on Friday.

Yemen isn't a major oil power, producing only 133,000 barrels a day according to the EIA, but the conflict sparked worries that fighting could spill over to other areas and potentially block the Bab el-Mandeb Strait--a key oil-transit point between the Persian Gulf and the Suez Canal.

"We haven't had a geopolitical fear premium put into the market in quite some time," said Tariq Zahir, managing member of Tyche Capital Advisors, a firm that guides and oversees client investments in commodity markets.

Many analysts said Thursday's rally was an overreaction to the heightened tensions. A bigger threat, pressuring oil prices lower, was the apparent progress being made on talks between the U.S. and Iran on an agreement that would limit the Middle Eastern nation's nuclear ambitions while lifting economic sanctions, including an oil-export embargo, that have punished the country. Traders and analysts cited reports that U.S. Secretary of State John Kerry resumed meetings with Iranian negotiators in Switzerland Thursday and voiced optimism that an agreement on a preliminary framework could be reached ahead of a March 31 deadline.

"For the weekend, we want to be positioned for the possibility of the Strait of Hormuz opening up rather than for the possibility of the Bab el-Mandeb shutting down," research firm Petromatrix said in a note.

Reports of progress in the negotiations increased the odds that a deal could be reached within days, analysts at Goldman Sachs wrote in a research note released late Thursday night. The key questions for the market then would be how fast the sanctions are lifted and how soon--and how much--Iranian oil might be returning to a global market already swimming in excess supplies.

In refined products, the front-month April gasoline futures fell 5.68 cents or 3% to $1.8249 a gallon on the Nymex. Diesel futures fell 1.8 cents or 1% to $1.7696 a gallon.

Write to Christian Berthelsen at christian.berthelsen@wsj.com

Subscribe to WSJ: http://online.wsj.com?mod=djnwires