Height distribution of Joule heating and its influence on the thermosphere