Yes, but if that is living area, it's a definite no-no. If it is used for storage or anything else, it is a "no". At the same time, wires are always stapled to the top of trusses or joists, and those trusses or joists are often used for limited storage, so unless that space is commonly used in some way, I wouldn't worry too much about it. You will just have to be careful in the future not to set anything on that wire and certainly not to step on it. In this case, the problem is not so much creating a fire hazard because of the wire in contact with wood, it is in possibly damaging that wire in the future, which could either cause a fire hazard or even eliminate the ability to carry current completely and thereby create a shock hazard somewhere else.