We study quenches across the Bose-Hubbard Mott-insulator-to-superfluid quantum phase transition by using an ultracold atomic gas trapped in an optical lattice. Quenching from the Mott insulator to the superfluid phase is accomplished by continuously tuning the ratio of Hubbard tunneling to interaction energy. Excitations of the condensate formed after the quench are measured by using time-of-flight imaging. We observe that the degree of excitation is proportional to the fraction of atoms that cross the phase boundary and that the quantity of excitations and energy produced during the quench have a power-law dependence on the quench rate. These phenomena suggest an excitation process analogous to the Kibble-Zurek mechanism for defect generation in nonequilibrium classical phase transitions.