China’s manufacturing activity unexpectedly contracted in October, damping hopes of increasing momentum in the world’s second-largest economy.