Stocks kicked off the first trading day of the month and quarter with modest gains, recovering from a recent string of declines, lifted by an upbeat manufacturing activity report and as investors seemed to shrug off the first partial government shutdown since 1996.

(Read more: After-hours buzz: Global Payments, Allstate & more)