The heart muscle can contract by itself, without the stimulation of a nerve. This is called myogenic muscle contraction.
The region that initiates each contraction is found in the wall of the right atrium and is called the pacemaker. Every time the pacemaker sends out a signal, a heartbeat results. The pacemaker is under the influence of nerves (autonomic control from the brain, specifically the medulla oblongata (brain stem)) and adrenaline.
One nerve carries messages from the medulla of the brain to the pacemaker and speeds up the beating of the heart by releasing a neurotransmitter (noradrenaline) to increase the rate of myocardial contraction. Another nerve carries messages from the medulla of the brain to the pacemaker and slows down the beating of the heart by releasing a neurotransmitter (acetylcholine) to decrease the rate of myocardial contraction.
Additionally, the heart rate may be increased by the chemical release of the hormone adrenaline (epinephrine) into the blood (from the adrenal gland) and once it reaches the pacemaker it signals it to increase the beating of the heart.