NMR and NQR studies of magnetism and superconductivity in the antiferromagnetic heavy fermion superconductors UM2Al3 (M=Ni and Pd)