Complications during pregnancy and labor are frequent and are especially damaging in populations with limited access to healthcare. To mitigate these complications, electrohysterograms (EHG), which measure abdominal electric potentials noninvasively, have been proposed for monitoring uterine activity. However, EHGs record electrical activity from sources besides the uterus, complicating their analysis. Here, we represent multi-electrode EHG measurements as tensors and develop a Bayesian tensor decomposition for estimating localized and distributed electrical activities. Using simulated measurements, we demonstrate that our method can estimate localized and distributed activities more accurately than other methods, achieving cosine similarities with the ground truth of 0.758 (95% confidence interval (CI): 0.726-0.790) and 0.997 (95% CI: 0.997-0.997), respectively. Using real measurements, we show the advantages of our method for separating uterine electrical activity during contractions from other electrical activities measured in EHGs, achieving averaged signal-to-noise ratios of 7.36 (95% CI: 6.70-8.02) and 9.05 (95% CI: 8.24-9.86) dB in two datasets. Such accurate estimation of uterine activity from EHG measurements could be useful in developing reliable future applications, implemented in portable devices, to reduce risks during pregnancy and labor.