Counting rational points of bounded height on algebraic varieties