Analytical results for a conditional phase shift between single-photon pulses in a nonlocal nonlinear medium