A sculpture by Dame Barbara Hepworth worth £3.5 million has been given a temporary export bar to prevent it from leaving the UK.