Cuba suffered a general blackout caused by a crash of its national electricity grid, officials have said.