Molecular proximity effects in two-photon absorption