Beyond Limber: efficient computation of angular power spectra for galaxy clustering and weak lensing