We perform switching current measurements of planar Josephson junctions (JJs) coupled by a common superconducting electrode with independent control over the two superconducting phase differences. We observe an anomalous phase shift in the current-phase relation of a JJ as a function of gate voltage or phase difference in the second JJ. This demonstrates the nonlocal Josephson effect, and the implementation of a φ0-junction which is tunable both electrostatically and magnetically. The anomalous phase shift is larger for shorter distances between the JJs and vanishes for distances much longer than the superconducting coherence length. Results are consistent with the hybridization of Andreev bound states, leading to the formation of an Andreev molecule. Our devices constitute a realization of a tunable superconducting phase source and could enable new coupling schemes for hybrid quantum devices.