A three-dimensional model for the radio emission of magnetic chemically peculiar stars