EchoStar and Viacom reach agreement