Causal structure of networks of stochastic processes