The unoccupied-states potential correction (USPC) in the local spin-density-functional (LSDF) formalism is proposed as a way to take correlation effects into account approximately. The method is based on using different potentials for the electrons in valence and conduction bands. When applied to antiferromagnetic transition-metal oxides (NiO, MnO, FeO, CoO), it solved the long-standing problem of reproducing the experimental values of the band gaps, which are underestimated in normal LSDF calculations. FeO and CoO become insulators, in contrast to the metallic ground state obtained in the usual LSDF calculations. Moreover, the calculated magnetic properties improved considerably due to the introduction of the USPC. It is shown that band-structure calculations using the USPC provide a correct description of available data from spectral measurements (ultraviolet photoelectron spectroscopy, X-ray photoelectron spectroscopy, bremsstrahlung isochromate spectroscopy) for these compounds.