Voltage-controlled magnetic anisotropy in heterostructures with a two-dimensional magnetic material