An advert urging grandparents to ask before hugging their grandchildren has been suspended after the justice minister branded it "inappropriate and demeaning".