×

Stocks rise; tech sector gains as Apple bounces back

U.S. stocks rose on Wednesday, rebounding after the S&P 500's largest decline in a month, with social-media shares helping lift the technology sector and as investors pondered when the Federal Reserve would start hiking interest rates.

"Technology is one of our favorite spots; (along with) any sector that does well in an economic upturn. There's an anticipation of a pretty good upgrade cycle for both consumers and business," said Jeff Kravetz, regional investment director for U.S. Bank Wealth Management.

Apple rose, halting a two-session drop, its shares up 3.1 percent a day after the provider of consumer technology unveiled a smartwatch and payment gadgets.

"Apple is an innovator again. Yesterday they said, 'hey, we're coming out with new products, and of course you absolutely need them. That's what Apple does best, convince people to buy products they didn't know they needed," said JJ Kinahan, chief strategist at TD Ameritrade.

Twitter rallied after UBS advised buying its shares; Facebook and LinkedIn also rose after UBS also raised its price targets on the social-media companies.

The decline in the cost of crude and a rise in consumer confidence bodes well for retail sales, analysts say.

"Consumer confidence is high; we're going to see that reflected in the retail-sales number," said Chris Gaffney, senior market strategist at EverBank Wealth Management, referring to August numbers to be released on Friday.

The "prospect of lower gas prices is a good thing for the consumer, you may go out for dinner, or spring for one of those new smartphones. You've got consumer confidence at a seven-year high, so consumers are feeling a little wealthier," said Kravetz.

"The economy will be strong enough to support higher rates," said Gaffney, who believes the Fed will begin hiking rates in the second quarter of next year or the start of the third, depending on the health of the U.S. economy.

The central bank is measuring the progress of the recovery as it readies to conclude its bond purchases and considers raising rates. The Fed begins its next two-day policy session in a week.

Symbol
Name
Price
 
Change
%Change
DJIA
---
S&P 500
---
NASDAQ
---

The Dow Jones Industrial Average gained 54.84 points, or 0.3 percent, to 17,068.71, with McDonald's leading blue-chip gains that extended to 21 of 30 components.

The S&P 500 added 7.25 points, or 0.4 percent, to 1,995.69, with technology pacing gains and utilities falling the most among its 10 main industry groups.

The CBOE Volatility Index, a measure of investor uncertainty, fell 4.6 percent to 12.88.

The Nasdaq climbed 34.24 points, or 0.8 percent, to 4,586.52.

For every seven shares falling, eight rose on the New York Stock Exchange, where nearly 609 million shares traded. Composite volume surpassed 2.9 billion.

NYSE New York Stock Exchange traders markets
Getty Images

The yield on the 10-year Treasury note used to figure mortgage rates and other consumer loans rose 3 basis points to 2.539 percent.

"Bonds selling off is a strange phenomena in that it's positive that people are starting to allocate out of fixed-income, but also nervous about rates going up," said Kinahan at TD Ameritrade.

The dollar fluctuated against the currencies of major U.S. trading partners and dollar-denominated commodities including gold and oil declined, with gold futures losing $3.20, or 0.3 percent, to $1,245.30 an ounce and crude dropping $1.08, or 1.1 percent, to $91.67 a barrel.

The government on Wednesday reported wholesale inventories rose 0.1 percent in July, versus expectations for 0.5 percent.

Read MoreCurb your estimates: Inventories near flat in July

Ahead of Wednesday's open, the Mortgage Bankers Association reported home-mortgage applications declined last week as interest rates rose.

On Tuesday, U.S. stocks tumbled, as Treasury yields climbed and investors considered when the Federal Reserve would start raising interest rates.

Read MoreUS stocks and Apple end lower; interest rates mulled

—By CNBC's Kate Gibson

Coming Up This Week:

Thursday

Earnings: Kroger, Lululemon Athletica, Ulta Salon

8:30 a.m.: Unemployment claims

10:30 a.m.: Natural gas inventories

1:00 p.m.: 30-year bond auction

2:00 p.m.: Treasury budget

Friday

Earnings: Darden Restaurants

8:30 a.m.: Retail sales

8:30 a.m.: Import/export prices

9:55 a.m.: Consumer sentiment

10:00 a.m.: Business inventories

More From CNBC.com: