Heart rate is controlled by multiple factors. Unlike skeletal muscle cells, heart cells can and do contract without a nerve telling it to. The group of heart muscle cells called the sinoatrial node or pacemaker establish the rhythm for the rest of the heart, because they beat the fastest.
But nerves connected to the heart, as well as hormones (epinephrine, norepinephrine), can act as accelerators to speed up or slow down the heart when necessary. Heart rate increases when sensory nerves signal the brain that the body is oxygen deprived or blood pressure is too low. Low oxygen, high CO2, or increases in acid, are detected by chemoreceptors located in the aorta, carotid arteries and the brain itself. Low blood pressure is detected by baroreceptors in the aorta and carotid arteries that respond to stretch, or rather lack of it.