For a cuprate superconductor, specifically the yttrium barium copper oxide system, we analyze the low-temperature phase diagram consisting of the superconducting, pseudogap, and normal phases by using a phonon-mediated attraction and Coulomb repulsion mechanism. Through this analysis, we show this mechanism in the cuprate is quite important for its key dynamics. For the pairing mechanism, a variational method is developed and applied, and a generalized mean field theory is used to calculate the condensate energy and the energy gap of the quasiparticle. We obtain a self-consistent system of equations for these quantities. The superconducting and pseudogap phases, which involve pair-condensates, are assumed to be equilibrium systems of the condensate and normal subphases. The condition for the phase transition point is given by the equal total electronic energy gains. Assuming that the difference in the pairing range of the pair condensate is small between just above and below the transition temperature, computations are performed to solve the self-consistent system of equations. We find solutions compatible with experimental data. Plausible values of the energy gap in the superconducting phase and in the pseudogap phase are obtained. The present analysis shows that the phonon-mediated attraction and Coulomb repulsion mechanism itself is compatible with the experimental data. The importance of the screening effect through one-phonon exchange in the pairing mechanism and of the structure of the valence band is discussed.