Higher spending on public services and benefits led to a rise in government borrowing, figures show.