Modelling the optimal conservation of interacting species