Elon Musk's X has agreed to pay Donald Trump about $10m (£8m) after suspending his accounts following the 2021 US Capitol riot by his supporters, according to reports.