Interaction of neuronal network architecture and spiking statistics through synaptic plasticity: self-consistent calculation of connections and pairwise activity