The gravitational collapse of a spherical cloud core is investigated by numerical calculations. The initial conditions of the core lie close to the critical Bonnor-Ebert sphere with a central density of ~104 cm-3 in one model (α = 1.1), while gravity overwhelms pressure in the other (α = 4.0), where α is the internal gravity-to-pressure ratio. The α = 1.1 model shows reasonable agreement with the observed velocity field in prestellar cores. Molecular distributions in cores are calculated by solving a chemical reaction network that includes both gas-phase and grain-surface reactions. When the central density of the core reaches 105 cm-3, carbon-bearing species are significantly depleted in the central region of the α = 1.1 model, while the depletion is only marginal in the other model. The two different approaches encompass the observed variations of molecular distributions in different prestellar cores, suggesting that molecular distributions can be probes of contraction or accumulation timescales of cores. The central enhancement of the NH3/N2H+ ratio, which is observed in some prestellar cores, can be reproduced under certain conditions by adopting recently measured branching fractions for N2H+ recombination. Various molecular species, such as CH3OH and CO2, are produced by grain-surface reactions. The ice composition depends sensitively on the assumed temperature. Multideuterated species are included in our most recent gas-grain chemical network. The deuterated isotopomers of H are useful as probes of the central regions of evolved cores, in which gas-phase species with heavy elements are strongly depleted. At 10 K, our model can reproduce the observed abundance ratio of ND3/NH3 but underestimates the isotopic ratios of deuterated to normal methanol.