A microscopic theory of superconductivity in the extended Hubbard model which takes into account the intersite Coulomb repulsion and electron-phonon interaction is developed in the limit of strong correlations. The Dyson equation for normal and pair Green functions expressed in terms of the Hubbard operators is derived. The self-energy is obtained in the noncrossing approximation. In the normal state, antiferromagnetic short-range correlations result in the electronic spectrum with a narrow bandwidth. We calculate superconducting Tc by taking into account the pairing mediated by charge and spin fluctuations and phonons. We found the d-wave pairing with highTc mediated by spin fluctuations induced by the strong kinematic interaction for the Hubbard operators. Contributions to the d-wave pairing coming from the intersite Coulomb repulsion and phonons turned out to be small.