Modeling the chemical evolution of a collapsing prestellar core in two spatial dimensions