Effects of phonons and antiferromagnetic spin fluctuations on the pairing and density of states in high-T c superconductors