Theory of electroabsorption by anisotropic and layered semiconductors. I. Two-dimensional excitons in a uniform electric field