Cluster algebra algorithm for computing q-characters