Oscillations in the voltage between two weakly connected current-carrying superconductors as a function of the applied magnetic field