We study by kinetic Monte Carlo simulations the catalytic oxidation of carbon monoxide on a surface in the presence of contaminants in the gas phase. The process is simulated by a Ziff-Gulari-Barshad (ZGB) model that has been modified to include the effect of the contaminants and to eliminate the unphysical oxygen-poisoned phase. The impurities can adsorb and desorb on the surface, but otherwise remain inert. We find that, if the impurities can not desorb, no matter how small their proportion in the gas mixture, the first order transition and the reactive window that characterize the ZGB model disappear. The coverages become continuous, and once the surface has reached a steady state there is no production of CO$_2$. This is quite different from the behavior of a system in which the surface presents a fixed percentage of impurities. When the contaminants are allowed to desorb, the reactive window appears again, and disappears at a value that depends on the proportion of contaminants in the gas and on their desorption rate.