The distribution of forces in a granular system under external stress is a spinglass problem