DirecTV and Viacom Inc. say they have settled a dispute that will bring shows such as those featuring the cartoon character Sponge Bob and the comedian Jon Stewart back to DirecTV subscribers.