Stocks were higher following two straight days of losses, and saw gains despite some lackluster economic data and the situation in Iraq show no improvement.

First, the scoreboard:

Dow: 16,775.74, 41.5, 0.25%

S&P 500: 1,936.16, 6, 0.3%

Nasdaq: 4,310.65, 13, 0.3%

And now, the top stories of the day

The University of Michigan's preliminary June consumer confidence reading came in at 81.2, lower than the 83.0 that was expected by economist. The reading was also lower than May's 81.9 print. Following the report, Cooper Howes at Barclays said, "In our view, while the trend in consumer expectations has been volatile, consumer perceptions of current conditions have been steadily trending higher amid improvements in housing and labor markets. We expect this to continue as the housing market bounces back from a soft Q1 and the unemployment rate falls further. While fluctuations in the expectations index could weigh on the headline in any given month, we expect the trend to remain broadly positive through the rest of the year."

Producer prices contracted by -0.2% in May against expectations for prices to climb 0.1% against a 0.6% increase in April. At Pantheon Macro, Ian Shepherdson said, "In one line: Pulled down by a hard-to-believe drop in profit margins." Shepherdson added: "The May PPI-FD fell 0.2%, below the consensus, +0.1%. The core fell 0.1%, also below the consensus, 0.1%. Well, we got this one completely wrong. We expected a third straight big increase in the core, consistent with the elevated selling price index in the NFIB survey. Instead, the new PPI measure of wholesale and retail profits margins - 'trade services' in the release - fell 0.5% m/m, following gains of 1.4% in both March and April. This is impossible to square with the NFIB numbers, and we expect a rebound next month. Margins aside, modest pipeline pressures are building in the goods sector, with core materials prices up 0.6% y/y, the first gain since Mar 12. But remember the new PPI is dominated by services. We think firms are seeking higher margins as insurance against rising wages."

In corporate news, Priceline acquired OpenTable for $2.6 billion, or about $103 per share of OpenTable. The deal valued OpenTable 46% higher than it closed on Thursday, and following the deal, a number of other internet-related stocks, including Groupon and Yelp, also advanced.

General Motors announced the recall of more than 510,000 current generation Chevrolet Camaros. The company said the recall was because of the risk a driver's knee could inadvertently cut off or reduce power.

The situation in Iraq was in focus again, and President Obama held a press conference regarding the matter, and said he would decide on a range of options but stressed that no U.S. troops would be sent to Iraq.

Oil prices remained elevated just below about $107 a barrel as the situation in Iraq remained unsettled.