Chelsea booked a spot in the FA Cup quarter-finals after a difficult 4-2 fifth-round win over Wrexham after extra time on Saturday.