Mean-Field Theory of the Electrical Double Layer in Ionic Liquids