June 3 (Reuters) - Central European manufacturing mostly contracted in May as Polish and Czech producers faced declining output and orders while Hungarian factory activity stayed muted.

Purchasing managers indices (PMI) around the region showed few signs of recovery in the near-term last month, although more manufacturers were optimistic of a recovery this year after a two-year decline.

S&P Global's Polish PMI fell to 45.0 in May from 45.9 in April, missing forecasts and staying below the 50 mark separating growth from contraction for the 25th month in a row.

Some analysts said two long holiday weekends in May weighed on the result.

In the Czech Republic, the S&P Global PMI rose to 46.1 in May, from 44.7 in April when it showed a surprise slump.

Hungary's PMI, published by the country's Association of Logistics, Purchasing and Inventory Management (MLBKT), was unchanged at 51.8 in May as it stayed slightly in growth territory. But production growth slowed, the survey said.

Manufacturers have been hit in the past two years by a jump in costs for materials or energy, along with falling demand from clients and consumers as an inflation surge weighed heavily on central Europe's economies.

With price growth already back near central bank targets, economists and policymakers forecast a revival in household consumption will help the region's economies grow this year after stagnation or contraction last year.

In manufacturing, demand continued to weaken, with new orders falling for the 27th month running, according to the Polish survey.

In the Czech survey, output continued to shrink amid subdued demand, according to the survey. However, the drop in output was the second-slowest in the past year and the decrease in new orders was the smallest in over two years.

Both surveys showed producers were more optimistic on a recovery this year, even as they deal with weakness in their main trading partners such as Germany.

"The greatest challenge for Polish industry remains difficulties in European economies like Germany and France, from which fewer orders are coming," Monika Kurtek, chief economist for Bank Pocztowy, said

"However, they are counting on recovery in these economies, and in (Poland) and the entire European Union, which is an optimistic sign."

(Reporting by Jason Hovet in Prague, Alan Charlish in Warsaw, and Anita Komuves in Budapest; Editing by Sriraj Kalluvila)