Sony Corp <6758.T> posted a quarterly operating loss as a stronger yen and weakness in its TV business countered the impact of cost cuts and the company retained its outlook for an annual loss.

Sony's operating loss totaled 25.7 billion yen ($270.8 million) in April-June, smaller than the consensus of a 103.1 billion yen loss in a poll of five analysts by Thomson Reuters.

The result compares with a 73.44 billion yen profit a year earlier.

Its flat TV operations were hit by cutthroat competition with Samsung Electronics Co Ltd <005930.KS>, while its videogame business trailed behind Nintendo Co Ltd's <7974.OS> Wii in the key U.S. market.

Sony is restructuring its businesses and is closing 8 manufacturing sites and cutting 16,000 jobs.

For the full business year to next March, Sony kept its forecast for an operating loss of 110 billion yen, about half the 227.8 billion loss it posted a year ago and versus analysts' estimate of a 117.7 billion yen loss.

Shares in Sony, the maker of Cyber-shot digital cameras, Vaio PCs and Bravia LCD TVs, gained 17 percent since April by Wednesday, underperforming a 29 percent rise in the Tokyo stock market's electrical machinery index <.IELEC.T>.

(Reporting by Kiyoshi Takenaka; Editing by Anshuman Daga)