O2 has said its 4G network has been restored after millions of customers were affected by a total service blackout.