Anthony Stokes scored three minutes from time to give Celtic a 1-0 victory over Dundee United at Tannadice.