Taylor rule and optimal monetary policy In a New Keynesian model, under the assumption of sticky prices, we need to express the monetary policy through an equation in order to close the model made of New-Keynesian Phillips curve and dynamic IS curve. 

I've read that an easy choice is to use the so called Taylor rule, which express the interest rate as a function of inflation (and possibly a random component). But, I've read that it is a suboptimal choice because it is something exogenous, whereas if we endogenously compute the optimal monetary policy we can reach a better result. 

My question is why using a Taylor rule when we know it is not optimal to do that?
I'm not sure I fully understand what you mean by computing it endogenously? The nominal interest rate would be endogenous in the NK framework because the output gap and inflation are endogenous. There'd be feedback between nominal interest rates and inflation, which both feed into each other for example. So in that sense I'd consider the approximation of interest rate policy using a Taylor rule as entailing that interest rate policy WAS endogenous wrt. the output gap and inflation. 

As for why we'd use the Taylor rule as opposed to some more complex but accurate approximation for interest rate policy... well I can only suppose that the Taylor rule is a sufficiently good approximation such that the marginal benefit of adding more complexity / accuracy is minimal and perhaps less than the computational cost of doing so. There comes a point where you start to prioritize parsimony more and more. Perhaps this is the motivation.