Interplay between electron-phonon and Coulomb interactions in cuprates