Self-consistent calculation of the frequency-dependent conductivity near the Anderson transition