Indian spinner Pragyan Ojha has announced his retirement from professional cricket with immediate effect.