NEW YORK — U.S. stock indexes closed moderately lower on Friday following three days of gains. Several technology stocks traded heavily, including Yahoo, Twitter and Facebook. Energy stocks fell along with a steep decline in the price of oil.

The Dow Jones industrial average lost 131.01 points, or 0.7 percent, to 18,261.45. The Standard & Poor’s 500 index lost 12.49 points, or 0.6 percent, to 2,164.69 and the Nasdaq composite index lost 33.78, or 0.6 percent, to 5,305.75.

Stocks posted solid gains this week, with the S&P 500 up 1.2 percent, as investors were relieved that the Federal Reserve decided to keep rates at their current low level. The next time the Fed could raise rates is November, but the general impression among investors is the central bank will not raise rates until December, long after the general election.

Oil prices fell sharply after reports that Saudi Arabia was unable to reach an agreement with Iran to cut production. U.S. benchmark crude oil futures closed down $1.84 to $44.48 a barrel on the New York Mercantile Exchange. Brent crude, used to price international oils, fell $1.76 to $45.89 a barrel.

Heating oil fell 5 cents to $1.41 per gallon.