Spatial distribution of the inversion and threshold characteristics of a molecular laser with optical pumping