Signature generation using hash function
The private key is actually the private exponent. Signature generation is modular exponentiation using the private exponent and - of course - the modulus. So you first hash a value for x using the hash function, giving you another value, say $h$. Now you perform the modular exponentiation on it and return the result. And that's all there is to it.
Note that you should not perform modular exponentiation by first perform exponentiation and then take the modulus: you can use the modulus in the intermediate steps (e.g. multiplication).
Do not think of signature generation as encryption with the private key. It only is similar in for textbook RSA, but otherwise that kind of comparison only hampers understanding of signature generation.