Spontaneous potential (SP) is routinely measured using wireline tools during reservoir characterization. However, SP signals are also generated during hydrocarbon production, in response to gradients in the water-phase pressure (relative to hydrostatic), chemical composition, and temperature. We use numerical modeling to investigate the likely magnitude of the SP in an oil reservoir during production, and suggest that measurements of SP, using electrodes permanently installed downhole, could be used to detect and monitor water encroaching on a well while it is several tens to hundreds of meters away. We simulate the SP generated during production from a single vertical well, with pressure support provided by water injection. We vary the production rate, and the temperature and salinity of the injected water, to vary the contribution of the different components of the SP signal. We also vary the values of the so-called "coupling coefficients," which relate gradients in fluid potential, salinity, and temperature to gradients in electrical potential. The values of these coupling coefficients at reservoir conditions are poorly constrained. We find that the magnitude of the SP can be large (up to hundreds of mV) and peaks at the location of the moving water front, where there are steep gradients in water saturation and salinity. The signal decays with distance from the front, typically over several tens to hundreds of meters; consequently, the encroaching water can be detected and monitored before it arrives at the production well. Before water breakthrough, the SP at the well is dominated by the electrokinetic and electrochemical components arising from gradients in fluid potential and salinity; thermoelectric potentials only become significant after water breakthrough, because the temperature change associated with the injected water lags behind the water front. The shape of the SP signal measured along the well reflects the geometry of the encroaching waterfront. Our results suggest that SP monitoring during production, using permanently installed downhole electrodes, is a promising method to image moving water fronts. Larger signals will be obtained in low-permeability reservoirs produced at high rate, saturated with formation brine of low salinity, or with brine of a very different salinity from that injected.