By Christian Berthelsen 

U.S. oil prices fell Friday, snapping a five-session winning streak as concerns about fighting in the Middle East faded, negotiators appeared optimistic about a nuclear agreement with Iran, and a measure of U.S. drilling activity underwhelmed the market.

U.S. crude oil for May delivery fell $2.56, or 5%, to settle at $48.87 on the New York Mercantile Exchange, giving back its gains from Thursday when Saudi Arabian bombing runs against Shiite rebels in Yemen had pushed prices higher. In electronic trading, the Nymex contract extended its losses, falling to $48.28 a barrel. Brent crude, the global benchmark, ended down $2.78, or 4.7%, at $56.41 a barrel on the ICE Futures Europe exchange.

The U.S. contract fell just shy of setting its best weekly gain in more than four years, as prices climbed this past week with the dollar cooling from recent highs--a factor that prompts some investors to dive into commodity markets--and as Middle East tensions raised concerns about potential supply interruptions.

Still, oil posted its best weekly gain since early February, rising 4.9% on the week. The Nymex contract 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 4.5% gain, the biggest in six weeks, was fueled by an escalation of a conflict in Yemen. Saudi Arabia launched airstrikes on Shiite Houthi rebels threatening to overtake the U.S.-backed government of President Abed Rabbo Mansour Hadi. Saudi 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 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 on Thursday and voiced optimism that 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.

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. The global glut has prompted a months-long selloff that brought oil prices down more than 50% from their peak last June.

Meanwhile, a weekly count of U.S. drilling activity by oilfield services company Baker Hughes disappointed bullish investors who were hoping for a larger decline. The company reported a fall of just 12 rigs this week, the smallest decline since the number of rigs working in the U.S. began falling in December. Though the number of drilling rigs has fallen by more than 40% from its peak, domestic production has continued to rise.

"The rig count was less than inspiring," said Phil Flynn, account executive at brokerage Price Futures Group in Chicago.

In refined products, the front-month April gasoline futures lost 8.37 cents, or 4.4%, to $1.7980 a gallon on the Nymex. Diesel futures fell 6.01 cents, or 3.4%, to $1.7275 a gallon.

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

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