Wrexham council has given the go-ahead for the government to build a new 2,100-inmate prison in north Wales at a cost of £212m.