A new jail that will hold 1,500 prisoners has opened near York.