By Caitlin Ostroff

U.S. stocks rose early Wednesday ahead of fresh data assessing recovery in the American services sector and job market.

The S&P 500 gained 0.4%, while the Dow Jones Industrial Average was up 0.69%. The tech-heavy Nasdaq Composite was ahead 0.08%.

Shares of Walt Disney had risen 6% in offhours trading after the media and entertainment company reported strong subscriber growth for its streaming service. Shares in payments company Square gained 12% in offhours trading after the company beat analysts' expectations for earnings and revenue.

In premarket trading, shares in CVS Health rose 3.1% after the pharmacy chain posted a rise in second-quarter profits. Shares in Regeneron Pharmaceuticals gained 2.5% after it said profit surged in the second quarter.

Gold gained 1.4% to $2,049.10 a troy ounce, extending a bull run that has gained momentum during the coronavirus pandemic. This year's sharp drop in yields on U.S. Treasurys to levels below the expected pace of inflation is making gold, which doesn't generate any income, more attractive as a store of value.

The precious metal, viewed as a haven asset, is also drawing investors concerned that the economic fallout from the pandemic may lead to another rout in stocks.

"It reminds me of the price rally in 2011 when gold posted its previous record," said Carsten Fritsch, an analyst at Commerzbank. He said gold could climb higher given guidance from the Federal Reserve that central bankers will keep interest rates low. "There's no hint of higher interest rates in the near future, even if there's an uptick in economic activity," he said.

Brent crude oil rose 3.3% to $45.89 a barrel, its highest since Saudi Arabia and Russia started a price and production war in March. Optimism among investors, falling U.S. inventories and a weaker dollar have supported oil. The ICE U.S. Dollar Index, which measures the greenback against a basket of currencies, fell 0.7%.

In bond markets, the yield on the 10-year Treasury ticked up to 0.540%, from 0.514% Tuesday, which was the second-lowest closing level this year. Government bond yields, which move inversely to price, have weakened in recent weeks following guidance from major central banks that interest rates are likely to remain low for an extended period.

The ADP National Employment Report showed nonfarm private-sector employment in the U.S. increased by 167,000 jobs in July, smaller than the 1 million increase economists expected.

Economists have worried that a rise in U.S. coronavirus infection rates last month could curtail the economic recovery as some regions moved to impose local restrictions to curb the number of cases. This week, new coronavirus cases have inched lower, lending to optimism for a faster recovery.

"What we have had so far is where economic activity and infection rates have been decoupled," said Altaf Kassam, head of investment strategy for State Street Global Advisors in Europe. "Going forward, we are going to have them much more coupled together. Economic activity and infection rates are going to be much more closely linked."

Data company IHS Markit is also scheduled to release figures showing activity in the services sector for July at 9:45 a.m. The Institute for Supply Management will release a measure of activity in the U.S. nonmanufacturing sector at 10 a.m.

Investors are also watching negotiations between White House officials and Democrats over a new coronavirus-relief package. While the two have yet to bridge differences in unemployment payments and other aid proposals, Treasury Secretary Steven Mnuchin said they aim to reach a deal by the end of the week, with lawmakers voting on the proposal next week.

Deteriorating relations between Beijing and Washington are also on the radar for markets, and are likely to weigh on investors' sentiment.

The U.S. and China have agreed to high-level talks on Aug. 15 to assess Beijing's compliance with the bilateral trade agreement signed early this year, The Wall Street Journal reported late Tuesday. While that meeting will be closely monitored, Health and Human Services Secretary Alex Azar's decision to visit Taiwan in coming days to discuss the pandemic could become another irritant in the ties with China.

Write to Caitlin Ostroff at caitlin.ostroff@wsj.com