The main reason for the many electric cars are the tax incentives. It would certainly been a lot fewer Teslas and more Nissan Leafs or similar cars if it had not been for the oil. The tax incentive came when the Think City line of cars was produced in Norway (starting in the late 90s) and was introduced to establish a market for electric cars. Since very few electric cars was sold, this was not very expensive, and few took electric cars seriously at the time.
Nobody had anticipated Tesla and similar cars, but now a lot of people had electric cars, and then it was politically difficult to remove the tax incentives.