Nonlocal splitting of photons on a nonlinear chip