The Uttar Pradesh government has inked pact with at least 34 foreign companies for investments largely in five sectors, including textiles, IT & electronics and pharma.