Microscopic and macroscopic entropy of extremal black holes in string theory