First principles description of the electronic properties of doped ZnO