Odd-frequency pairing and Kerr effect in the heavy-fermion superconductor UPt3