Small- and large-x nucleon spin structure from a global QCD analysis of polarized parton distribution functions