Retail sales nationwide declined for the first time in three months in June, sapping an economy that analysts say struggled last quarter amid sluggish exports and production.

Sales slid 0.8 percent from May, when they gained 1.7 percent, government data released on Wednesday show. The median forecast was for a drop of 0.9 percent, according to a survey by Bloomberg.

Weakness in consumer spending adds to risks to the world's third-biggest economy, whose manufacturing sector has struggled with softness in exports to Asia. The task for Prime Minister Shinzo Abe is to convince companies to continue to boost wages to help consumers cope with a rise in living costs that the central bank sees picking up quickly this year.

"Pensioners and people with low incomes may be cautious about their expenses, restraining consumption," said Kiichi Murashima, an economist at Citigroup Inc., who estimates the economy contracted last quarter due to declines in domestic consumption and exports.

JPMorgan Chase & Co. is among those that estimate the economy contracted in the three months through June, ending a two-quarter rebound from last year's recession. The economy may have shrunk as much as an annualized 2.5 percent, says Yoshiki Shinke at Dai-ichi Life Research Institute.

The Cabinet Office will release the second-quarter gross domestic product figures on Aug. 17.

A record 62 percent of Japanese households described their livelihoods as "hard" last year, a health ministry survey on incomes showed earlier this month.