Computing the Thurston–Bennequin invariant in open books