Senior councillors have agreed to spend almost £6m to repair the roof of one of Wakefield’s most iconic buildings.