UK votes to remain in European Community in first nationwide referendum