Surface effects and impurity production in tokamak machines