Italian factory activity shrank in January at the slowest rate since last March as a contraction in output eased for the second month in a row, a survey showed on Friday.

It was 18th straight month of contraction, suggesting the euro zone's third-largest economy, struggling to emerge from a debt crisis, remains stuck in a recession that began back in mid-2011.

But the data on the manufacturing sector, which according to statistics office ISTAT accounts for about 19 percent of Italian economic output, also indicated that the steepest phase of the downturn may be over.

The Markit/ADACI Purchasing Managers Index rose for the second month to 47.8 in January from 46.7 in December, while remaining below the 50 mark that separates growth from contraction.

A Reuters survey of 13 analysts had forecast the index would rise to 47.4 in January. Estimates ranged from 47.0 to 48.2.

Italy's economy, the most sluggish in the euro zone for more than a decade, has contracted for five consecutive quarters up to the third quarter of 2012.

A Reuters poll in January predicted a return to growth only in the third quarter of this year and saw the economy shrinking by 1 percent in 2013, five times more than outgoing Prime Minister Mario Monti's government predicts.

The PMI showed manufacturing output shrank again in January, but at the slowest rate in the past 16 straight months of contraction, with the sub-index rising to 49.1 from 46.0.

The pace of staff shedding, on the other hand, accelerated in January, with companies mentioning a lack of new orders as a reason for laying off employees.

Italy's unemployment rate was 11.1 percent in November, its highest in a monthly series dating back to 2004. Youth unemployment has ballooned to a record above 37 percent, data from statistics agency ISTAT shows.

Input prices in the factory sector rose for the fifth month in a row, Markit said, although the rate of inflation was the weakest since September. Output prices rose for the third month running as businesses sought to pass on higher costs to clients.

(Reporting By Catherine Hornby; Editing by Hugh Lawson)