Factory activity in China has contracted for a second straight month as the country's economy loses steam.