Scotland votes to stay in the United Kingdom after rejecting independence, official results confirm.