A strategic model of complex networks formation