US factory activity shrank in October for an eighth straight month, driven by a pullback in production and tepid demand.