NEW YORK (AP) -- Stocks eked out tiny gains Wednesday as oil prices continued to recover and investors hoped the worst is over for the beleaguered energy industry. Telecommunications companies, which have climbed as the rest of the market has struggled this year, also rose.
Indexes wavered between tiny gains and losses for most of the day, then climbed steadily in the last 90 minutes of trading. Oil prices increased for the seventh time in eight days, an encouraging sign after many months of sharp declines. After Tuesday's big gains, the market is the highest it's been since the first week of the year.
The Dow Jones industrial average rose 34.24 points, or 0.2 percent, to 16,899.32. The Standard & Poor's 500 index gained 8.10 points, or 0.4 percent, to 1,986.45. The Nasdaq composite index added 13.83 points, or 0.3 percent, to 4,703.42.
The price of oil has been plunging for almost two years, from over $100 a barrel in mid-2014 to $26 a barrel last month. That decimated profits at energy companies and hurt banks that lent money to them. Oil has staged a modest recovery over the last couple of weeks.
Benchmark U.S. crude rose 26 cents to close at $34.66 a barrel in New York, its highest closing price since Jan. 5. Brent crude gained 12 cents to $36.93 a barrel in London.
Energy stocks did the best in the market. Murphy Oil climbed $2.08, or 12.1 percent, to $19.30, and Marathon Oil picked up $1.14, or 14.3 percent, to $9.10. Telecom stocks also rose, with Verizon Communications up 66 cents to $52.12. Verizon and AT&T are trading at their highest prices in more than a year.
Agribusiness giant Monsanto took its biggest one-day loss in five years after it slashed its annual profit forecast. The company cited the strong dollar, competition from lower-cost generic products, and reduced spending from farmers because of lower crop prices. The stock tumbled $7.19, or 7.8 percent, to $85.30.
The news pressured other materials companies including fertilizer maker CF Industries, which fell $1.51, or 4.2 percent, to $34.74.
Spirits maker Brown-Forman, whose brands include Jack Daniels and Korbel, also lowered its profit estimates because of the strong dollar. The company makes 60 percent of its sales overseas. It's also being affected by cutbacks in spending by travelers and weak economies in some emerging markets. Its stock fell $1.47 to $96.19.
A strong dollar hurts U.S. companies in a couple of ways when they do business overseas: it makes their products more expensive compared to locally-produced goods, and it reduces their revenue when it's translated back into dollars.
Katie Nixon, chief investment officer of wealth management for Northern Trust, said that matters because economic growth is so slow right now. Still, she said it's not a big problem for the U.S. economy as a whole, which relies more on services than sales of goods.
"The strong dollar is much more of an issue for the S&P 500 than it is for the U.S. economy," she said.
ADP, a payroll processing company, delivered another positive sign for the economy when it said private U.S. businesses added a healthy 214,000 jobs last month. That followed upbeat reports on construction and manufacturing on Tuesday. The federal government will release its jobs report on Friday.
Bond prices fell. The yield on the 10-year Treasury note rose to 1.84 percent from 1.82 percent a day earlier. Bond yields also climbed on Tuesday.
"The Treasury yield is increasing because the economy is better than people had feared and investors feel that the Fed is going to hike rates," Nixon said.
Bond yields are still relatively low. That has helped telecommunications and utility stocks, which are seen as similar to bonds: they are less-volatile stocks that tend to pay high dividends. Investors have favored them in recent months as the rest of the market turned turbulent. They are the two best performing sectors in the market so far this year.
Sporting goods retailer Big 5 Sporting Goods fell $1.38, or 10.4 percent, to $11.91 as it offered a weak profit forecast, and competing retailer Sports Authority said it will file for Chapter 11 bankruptcy protection and close almost a third of its stores.
Digital health and wellness company Everyday Health leapt 89 cents, or 19.1 percent, to $5.55 following a strong quarterly report. Teen retailer Abercrombie & Fitch rose $1.27, or 4.4 percent, to $30.41 after it said its Hollister business did particularly well in the latest quarter.
Germany's DAX rose 0.6 percent and France's CAC rose 0.4 percent. The FTSE 100 index of leading British shares dipped 0.1 percent after asset manager BlackRock warned that if the U.K. votes to leave European Union, the economy will be "economically worse off."
A weak yen added to investor optimism, sending Japan's benchmark Nikkei 225 up 4.1 percent. Hong Kong's Hang Seng added 3.1 percent.
The price of gold rose $11 to $1,241.80 an ounce. Silver rose 27 cents to $15.02 an ounce. Copper rose 4 cents to $2.18 a pound.
In other energy trading, the price of natural gas fell 6 cents to close at $1.68 per 1,000 cubic feet. Natural gas is at its lowest price in 17 years. Wholesale gasoline rose 1 cent to $1.31 a gallon. Heating oil rose 1 cent to $1.11 a gallon.
The euro was unchanged at $1.0868 and the dollar fell to 113.45 yen after climbing to 114.05 yen Tuesday.