Phonons and d -wave pairing in the two-dimensional Hubbard model