d-wave superconductivity and antiferromagnetism in UPt3