We introduce and investigate the multiband d − p model describing a IrO4 layer (such as realized in Ba2IrO4) where all 34 orbitals per unit cell are partly occupied, i.e., t2g and eg orbitals at iridium and 2p orbitals at oxygen ions. The model takes into account anisotropic iridium-oxygen d − p and oxygen-oxygen p − p hopping processes, crystal-field splittings, spin-orbit coupling, and the on-site Coulomb interactions, both at iridium and at oxygen ions. We show that the predictions based on assumed idealized ionic configuration (with n0 = 5 + 4 × 6 = 29 electrons per IrO4 unit) do not explain well the independent ab initio data and the experimental data for Ba2IrO4. Instead we find that the total electron density in the d − p states is smaller, n = 29 − x < n0 (x > 0). When we fix x = 1, the predictions for the d − p model become more realistic and weakly insulating antiferromagnetic ground state with the moments lying within IrO2 planes along (110) direction is found, in agreement with experiment and ab initio data. We also show that: (i) holes delocalize over the oxygen orbitals and the electron density at iridium ions is enhanced, hence (ii) their eg orbitals are occupied by more than one electron and have to be included in the multiband d − p model describing iridates.