Patterned Rydberg excitation and ionization with a spatial light modulator