Substrate-mediated dispersion interaction between adsorbed atoms and molecules