Molecular Evolution in Collapsing Prestellar Cores. II. The Effect of Grain-Surface Reactions