Theory of magnetism in diluted magnetic semiconductor nanocrystals