Recognizing string graphs in NP