UK companies paid out a record amount in dividends in the second quarter of this year.