I think the outer enclosing set of double quotes in your var1=.... statement might need to be single quotes (I assume the triple-quotes are just there for show and not what you actually typed). I have no familiarity with mosquitto but have had a few wrestling matches with shell syntax over the year . . . using "echo" as a mosquitto substitute fixed it for me . . .
var2='{"name":"Harini", "age":24, "city":"NewYork", "message":"Hello world"}'
echo {\"Contents\":$var2}
{"Contents":{"name":"Harini", "age":24, "city":"NewYork", "message":"Hello world"}}
var3="{"name":"Harini", "age":24, "city":"NewYork", "message":"Hello world"}"
bash: world}: command not found...
echo $var3
Might possibly be shell-dependent (I was using bash).