Cuba has restricted access to social media and messaging platforms including Facebook and WhatsApp, in the wake of the biggest anti-government protests in decades.