We derive an effective single-band Hubbard type Hamiltonian for CuO2 planes. The Hamiltonian includes both electron-electron repulsion and electron-phonon coupling to oxygen vibrational modes. We start with first-principles density functional theory parameters and then map onto a single-band model. Unlike previous mappings to a single-band Hamiltonian, ours explicitly preserves the Fermi surface shape and matrix elements of the many-band Hamiltonian. We consider both in-plane oxygen breathing modes as well as out-of-plane tilting modes. The latter modes have a quadratic electron-phonon coupling, and are also highly anharmonic in La2CuO4 based superconductors. The coupling to breathing modes is too small to account for highTc, while the coupling to quadratic modes is much stronger even though they would be neglected in a standard Migdal-Eliashberg approach to superconductivity.