Both sentences are correct.
For the first sentence, it specifically demands for the necessity of electricity. While the second sentence generally demands for necessity of electricity. Therefore, the article is correctly used in both sentences. Your intention plays the major role here.