Model atmospheres of A and B stars are computed taking into account magnetic line blanketing. These calculations are based on the new stellar model atmosphere code LLMODELS which implements a direct treatment of the line opacities and ensures an accurate and detailed description of the line absorption. The anomalous Zeeman effect was calculated for field strengths between 1 and 40kG and a field vector perpendicular to the line of sight. The magnetically enhanced line blanketing changes the atmospheric structure and leads to a redistribution of energy in the stellar spectrum. The most noticeable feature in the optical region is the appearance of the λ5200 broad, continuum feature. However, this effect is prominent only in cool A stars and disappears for higher effective temperatures. The presence of a magnetic field produces an opposite variation of the flux distribution in the optical and the UV regions. A deficiency of the UV flux is found for the whole range of considered effective temperatures, whereas the "null wavelength region" where the flux remains unchanged shifts towards the bluer wavelengths for higher temperatures.