Electromagnetic mass models in general relativity