NEW YORK (AP) -- U.S. stocks edged higher Wednesday as energy companies climbed with the price of oil. Banks also rose, and investors sold traditionally safe stocks. A survey showed that hiring by private companies continued at a solid but uninspiring clip in July.
Stocks opened lower but gradually recovered to finish at their highest levels of the day. The price of oil jumped after the U.S. government said gasoline stockpiles shrank last week. A survey showed private U.S. business payrolls grew by 179,000 in July as retailers and shipping firms hired more workers. That suggests hiring is still healthy, but that wasn't enough to excite investors.
"So much of this (economic) recovery could be correctly categorized as slow but steady," said Mike Baele, senior portfolio manager with U.S. Bank's private client reserve. "It's all better than last year, for the most part, but it's also all below expectations."
The Dow Jones industrial average broke a seven-day losing streak and added 41.23 points, or 0.2 percent, to 18,355. The Standard & Poor's 500 index gained 6.76 points, or 0.3 percent, to 2,163.79. The Nasdaq composite rose 22 points, or 0.4 percent, to 5,159.74.
The employment survey by payroll processor ADP suggests employers continue to hire new workers and at a faster pace than they were this spring, when hiring slowed sharply. Still, growth has been sluggish this year. The Labor Department will release a report Friday that includes hiring by government as well as private companies. Experts think it will show a gain of about 175,000 jobs.
The price of crude oil jumped after the U.S. government said stockpiles of gasoline shrank by more than 3 million barrels last week. S&P Global Platts said that was far more than expected, and that total oil production also decreased slightly. That helped oil bounce back from the slump that's taken it from $50 a barrel in early June down to around $40.
Benchmark U.S. crude added $1.32, or 3.3 percent, to $40.83 a barrel in New York. Brent crude, which is used to price international oils, rose $1.30, or 3.1 percent, to $43.10 a barrel in London.
That translated into big gains for energy companies. Williams Cos. rose $1.71, or 7.1 percent, to $25.67 and Devon Energy gained $1.88, or 5.2 percent, to $38.
Financial stocks also traded higher. Insurance company American International Group jumped following a strong second-quarter report. AIG stock rose $3.96, or 7.3 percent, to $58.10. Intercontinental Exchange, the owner of the New York Stock Exchange and other stock markets, said it will split its stock 5-for-1 and buy back $1 billion in shares. Its stock rose $14.09, or 5.3 percent, to $278.02.
Earnings reports continued to stream in. Luxury clothing, handbag and accessories company Kate Spade skidded $3.67, or 18.2 percent, to $16.47 after it disclosed weak results and lowered its estimates for the year. Kate Spade said travelers aren't spending as much money at stores that depend on shopping by tourists.
Footwear maker Crocs plunged after its second-quarter sales fell $25 million short of analyst estimates. Crocs projected a bigger shortfall in the current quarter, and the company said it expects overall revenue to shrink this year. Its stock gave up $2.56, or 23.3 percent, to $8.44.
Fitness tracker maker Fitbit rebounded after its quarterly results came in stronger than expected. The stock rose $1.77, or 13.4 percent, to $14.93. The stock is still down 50 percent this year, and a year ago it was trading around $50 per share.
Etsy climbed $1.13, or 8.9 percent, to $13.84. The online crafts marketplace said sales were better than expected and raised its sales and other projections for the year.
Zagg, a mobile device accessory company that bought smartphone charger company Mophie earlier this year, reported an unexpected profit and sales that were stronger than estimates. Among other factors, it said the "Pokemon Go" craze boosted its sales as players needed to recharge their phones more often. The stock rose 67 cents, or 10.5 percent, to $7.03.
The price of gold fell $8.30 to $1,356.10 an ounce. Silver fell 23 cents, or 1.1 percent, to $20.47 an ounce. Copper lost 1 cent to $2.20 a pound.
In other energy trading, wholesale gasoline rose 4 cents to $1.35 a gallon. Heating oil added 3 cents to $1.29 a gallon. Natural gas gained 11 cents to $2.84 per 1,000 cubic feet.
France's CAC 40 dipped 0.2 percent, as did the FTSE 100 in Britain. Germany's DAX picked up 0.3 percent. Japan's benchmark Nikkei 225 slipped 1.9 percent and South Korea's Kospi lost 1.2 percent. Hong Kong's Hang Seng dipped 1.8 percent. Japanese stocks have been slipping because the country's recently-announced stimulus package, worth around $272 billion, fell short of expectations. Much of the money is already in the pipeline. Meanwhile a strong yen is also deepening pessimism over prospects for Japan's recovery.
Bond prices inched higher and the yield on the 10-year Treasury note fell to 1.55 percent from 1.56 percent. The dollar rose to 101.13 yen from 100.88 yen. The euro fell to $1.1145 from $1.1227.