Engineering the magnetic anisotropy of an ultrathin Co layer sandwiched between films of Mo or Au