High-sensitivity spin-based electrometry with an ensemble of nitrogen-vacancy centers in diamond