Social media websites will have to delete extremist content on their platforms within an hour to avoid the risk of being fined.