Contact tracers use a mix of phone calls, texts and (where a person has provided an email address) emails. See 'When we contact you' here:
https://www.gov.uk/guidance/nhs-test-and-trace-how-it-works
They will contact everyone who has been, or who might have been, a 'contact' of the person who has tested positive.
A contact in a hospitality setting is considered as someone within one metre of them with whom they have had a face-to-face conversation, had skin-to-skin physical contact, have coughed on, or been in other forms of contact within one metre of them for one minute or longer; or someone within two metres of them for more than 15 minutes. In practice that might mean that the contact tracers will need to contact everyone who was in the pub at the relevant time but if they can narrow things down a bit (e.g. because the pub had kept a record of which tables different groups were sitting at) they will obviously do so.