Prisoner numbers have surged in part because of a rise in the number of people being arrested and kept on remand for domestic violence offences.